import request from '@/utils/request'
const tech = '/teacher'
export default
    {
        getList(page, limit, searchObj) {
            return request({
                url: `${tech}/teacher-list/${page}/${limit}`,
                method: 'post',
                data: searchObj
            })
        },
        //删除讲师
        deleteTeacherById(id) {
            return request({
                url: `${tech}/${id}`,
                method: 'delete'
            })
        },

        //添加讲师
        addTeacher(teacher) {
            return request({
                url: `${tech}/add`,
                method: 'post',
                data: teacher
            })
        },

        //根据id查询讲师  数据回显
        getTeacherInfo(id) {
            return request({
                url: `${tech}/${id}`,
                method: 'get'
            })
        },

        //修改讲师
        updateTeacher(teacher) {
            return request({
                url: `${tech}/${teacher.id}`,
                method: 'put',
                data: teacher
            })
        },

    }
